package com.file_.PrintStreamAndWriter;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

/*
 * PrintWriter（字符打印流）
 * */
public class Demo3 {
    public static void main(String[] args) throws IOException {
        // 1、创建字符打印流对象
        // 2、指定输出位置
        PrintWriter printWriter = new PrintWriter(new FileWriter("D:\\A_Test\\printWriter.txt"));
        printWriter.print("hi,你好世界");
        // 3、必须close，不然打印不进去
        printWriter.close();
    }
}
